-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More CLI commands #642
More CLI commands #642
Conversation
I think it is already hooked into the monorepo. In order for it to execute the prereqs I think you would need to run the commands from the root of the repo and specify the project. So instead of
you can do
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! LGTM
This reverts commit 56845ca.
@wjthieme Also, in local env, |
Updates
package.json
The type of CLI (
@orca-so/whirlpools-sdk-cli
) ismodule
to use top level async.But it needs
dist
directory to loadcommon-sdk
andwhirlpools-sdk
.yarn
creates symbolic link to/legacy-sdk/common
and/legacy-sdk/whirlpool
and those directory may not containdist
(withoutyarn run build
).So now it uses the previous version of SDKs.
Could we resolve this issue in more smart way ?
Tweaks on existing commands
initializeWhirlpool
initializeTickArray
sendTransaction
functiondefaultPriorityFeeInLamports
parameter to skip "initial" ask of priority feealts
to use ALTsNew commands
initializePositionBundle
This command initialize a new PositionBundle.
ALT related commands
initializeAltForBundledPositions
This command initialize an ALT and add 256 addresses.
These 256 addresses are the addresses of bundled positions of given PositionBundle.
It helps to merge more TransactionBuilders into one TransactionBuilder to reduce the number of required transactions.
initializeAltForWhirlpool
This command initialize an ALT and add the following addresses.
This ALT also helps to merge more TransactionBuilders into one TransactionBuilder.
The point is that this ALT is just for wallet user because it contains ATA for the wallet.
syncPositionBundleState
This command is the main part of this PR.
It receives a CSV file defining the target state of bundled positions.
Then it will check the current state of the bundled positions, and it will build (and send) transactions to modify state.
Examples
open
If the command receives the following CSV with empty PositionBundle account, it will open 6 positions with the given range and liquidity value.
close
If the command receives the following CSV with a PositionBundle containing 6 open positions, it will close 6 positions.
modify range and liquidity
If the command receives the following CSV with empty PositionBundle account, it will open 5 positions with the given range and liquidity value.
After the first "sync", if the command receives the following CSV, it will do the following.
bundleIndex = 0
) and re-open it because its range have been changedbundleIndex = 5
) with the given liquidity because its state have been changed fromclosed
toopen
Sample Output
Future work
There are some TODOs on
syncPositionBundleState
.This is not a major problem for use and will be postponed to the future as the urgent need for this command has disappeared. 😇